﻿using GoodAdmin.Core;

namespace GoodAdmin.System;

/// <summary>
/// 系统角色
/// </summary>
[SugarTable("Sys_Role", "系统角色表")]
public class SysRole:BaseEntity
{
    /// <summary>
    /// 权限名称
    /// </summary>
    [SugarColumn(ColumnDescription = "权限名称", Length = 64,IsNullable =false)]
    public virtual string RoleName { get; set; }
    /// <summary>
    /// 权限编码
    /// </summary>
    [SugarColumn(ColumnDescription = "权限编码", Length = 64, IsNullable = false)]
    public virtual string Code { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 64, IsNullable = true)]
    public string Remark { get; set; }
    /// <summary>
    /// 状态
    /// </summary>
    [SugarColumn(ColumnDescription = "状态", Length = 64, IsNullable = false)]
    public string Status { get; set; }
    /// <summary>
    /// 排序码
    /// </summary>
    [SugarColumn(ColumnDescription = "排序码", IsNullable = true)]
    public int? SortCode { get; set; } = 999;
    /// <summary>
    /// 数据范围
    /// </summary>
    [SugarColumn(ColumnDescription = "数据范围", Length = 64, IsNullable = false)]
    public virtual string DataScope { get; set; }

    /// <summary>
    /// 系统标识字段
    /// </summary>
    [SugarColumn(ColumnDescription = "系统标识", Length = 32, IsNullable = true)]
    public string SystemMark { get; set; }

    /// <summary>
    /// 自定义数据范围
    /// </summary>
    [SugarColumn(ColumnName = "DefineScopeOrgList", ColumnDescription = "自定义数据范围", IsJson =true, ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public List<long> DefineScopeOrgList { get; set; }

}

/// <summary>
/// 数据范围
/// </summary>
public class ApiRole
{
    /// <summary>
    /// 路由
    /// </summary>
    public string RouteUrl { get; set; }
    /// <summary>
    /// 组织
    /// </summary>
    public List<long> OrgList { get; set; }

    /// <summary>
    /// 数据范围类型
    /// </summary>
    public string ScopeType { get; set; }
}